import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import axios from 'axios'
// 引入chars
import * as echarts from 'echarts'

// 导入全局样式表
import './assets/css/global.css'
import preventReClick from './util/preventReClick'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
// 防止多次请求
Vue.use(preventReClick)
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false
// 全局配置axios
Vue.prototype.$ajax = axios
// 默认地址
// axios.defaults.baseURL = 'http://10.104.13.82/infosmart/buildingno/'
axios.defaults.baseURL = 'http://10.104.13.82/infosmart/'
// axios.defaults.baseURL = 'http://localhost:3000'
// 在 request 拦截器中，展示进度条 NProgress.start()
axios.interceptors.request.use(config => {
	NProgress.start()
	return config
})
// 在 response 拦截器中，关闭进度条 NProgress.done()
axios.interceptors.response.use(config => {
	NProgress.done()
	return config
})
new Vue({
	router,
	render: h => h(App)
}).$mount('#app')
